Fix QueryCompilationError with undefined expression type#1082
Merged
Conversation
…perator usage
When users accidentally use JavaScript's comparison operators (===, !==, <, >, etc.)
in where() callbacks instead of query builder functions (eq, gt, etc.), the query
builder now throws a helpful InvalidWhereExpressionError with clear guidance.
Previously, this mistake would result in a confusing "Unknown expression type: undefined"
error at query compilation time. Now users get immediate feedback with an example of
the correct syntax.
Example of the mistake this catches:
❌ .where(({ user }) => user.id === 'abc')
✅ .where(({ user }) => eq(user.id, 'abc'))
🦋 Changeset detectedLatest commit: 503f33e The changes in this PR will be included in the next version bump. This PR includes changesets to release 12 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
More templates
@tanstack/angular-db
@tanstack/db
@tanstack/db-ivm
@tanstack/electric-db-collection
@tanstack/offline-transactions
@tanstack/powersync-db-collection
@tanstack/query-db-collection
@tanstack/react-db
@tanstack/rxdb-db-collection
@tanstack/solid-db
@tanstack/svelte-db
@tanstack/trailbase-db-collection
@tanstack/vue-db
commit: |
Contributor
|
Size Change: +277 B (+0.31%) Total Size: 89.8 kB
ℹ️ View Unchanged
|
Contributor
|
Size Change: 0 B Total Size: 3.35 kB ℹ️ View Unchanged
|
willmruzek
approved these changes
Dec 31, 2025
willmruzek
left a comment
There was a problem hiding this comment.
I don't know if my review counts, but LGTM! Thank you!
kevin-dp
approved these changes
Jan 6, 2026
Contributor
kevin-dp
left a comment
There was a problem hiding this comment.
LGTM. Left a nit that claude can address.
Extract duplicate valueType determination logic from where() and having() methods into a shared getValueTypeName() helper function. Addresses review feedback from kevin-dp on PR #1082. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Contributor
|
|
Contributor
|
🎉 This PR has been released! Thank you for your contribution! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…perator usage
When users accidentally use JavaScript's comparison operators (===, !==, <, >, etc.) in where() callbacks instead of query builder functions (eq, gt, etc.), the query builder now throws a helpful InvalidWhereExpressionError with clear guidance.
Previously, this mistake would result in a confusing "Unknown expression type: undefined" error at query compilation time. Now users get immediate feedback with an example of the correct syntax.
Example of the mistake this catches:
❌ .where(({ user }) => user.id === 'abc')
✅ .where(({ user }) => eq(user.id, 'abc'))
🎯 Changes
✅ Checklist
pnpm test:pr.🚀 Release Impact